Common I/O Tasks
The xtd::io namespace provides several classes that allow for various actions, such as reading and writing, to be performed on files, directories, and streams. For more information, see File and Stream I/O.
Preamble
Prefer in your application to use the Input/output library and Filesystem library of the std.
xtd has its own IO API because the Filesystem library doesn't work on all OS (like for example iOS).
Some features exist only in the xtd API like binary reader/writer, stream reader/writer, string reader/writer and text reader/writer.
Common File Tasks
Common Directory Tasks
To do this... | See the example in this topic... |
---|---|
Access a file in a special folder such as My Documents | How to: Write Text to a File |
Create a directory | xtd::io::directory::create_directory method xtd::io::file_info::directory property |
Create a subdirectory | xtd::io::directory_info.create_subdirectory method |
Rename or move a directory | xtd::io::directory::move method xtd::io::directory_info::move_to method |
Copy a directory | How to: Copy Directories |
Delete a directory | xtd::io::directory::remove method xtd::io::directory_info::remove method |
See the files and subdirectories in a directory | How to: Enumerate Directories and Files |
Find the size of a directory | xtd::io::directory_info::length class |
Determine whether a directory exists | xtd::io::directory::exists method |